﻿using Microsoft.EntityFrameworkCore.Migrations;
using TiaoTaoHelper.Wtm.Units.EFCore;

#nullable disable

namespace HengTong.DataAccess.Migrations
{
    /// <inheritdoc />
    public partial class 站点配置增加微信小程序appid等字段 : TransactionalMigration
    {
        /// <inheritdoc />
        protected override void UpWithTransaction(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<string>(
                name: "TenantCode",
                table: "SysSiteConfig",
                type: "nvarchar(128)",
                maxLength: 128,
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "SmsAppId",
                table: "SysSiteConfig",
                type: "nvarchar(128)",
                maxLength: 128,
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "Name",
                table: "SysSiteConfig",
                type: "nvarchar(128)",
                maxLength: 128,
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true);

            migrationBuilder.AddColumn<string>(
                name: "SmsHost",
                table: "SysSiteConfig",
                type: "nvarchar(256)",
                maxLength: 256,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "SmsSecretKey",
                table: "SysSiteConfig",
                type: "nvarchar(128)",
                maxLength: 128,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "SmsSecretName",
                table: "SysSiteConfig",
                type: "nvarchar(128)",
                maxLength: 128,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "WechatMpAppId",
                table: "SysSiteConfig",
                type: "nvarchar(128)",
                maxLength: 128,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "WechatMpAppSecret",
                table: "SysSiteConfig",
                type: "nvarchar(128)",
                maxLength: 128,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "WechatWebAppId",
                table: "SysSiteConfig",
                type: "nvarchar(128)",
                maxLength: 128,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "WechatWebRedirectUri",
                table: "SysSiteConfig",
                type: "nvarchar(256)",
                maxLength: 256,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "WechatWebSecret",
                table: "SysSiteConfig",
                type: "nvarchar(128)",
                maxLength: 128,
                nullable: true);
        }

        /// <inheritdoc />
        protected override void DownWithTransaction(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "SmsHost",
                table: "SysSiteConfig");

            migrationBuilder.DropColumn(
                name: "SmsSecretKey",
                table: "SysSiteConfig");

            migrationBuilder.DropColumn(
                name: "SmsSecretName",
                table: "SysSiteConfig");

            migrationBuilder.DropColumn(
                name: "WechatMpAppId",
                table: "SysSiteConfig");

            migrationBuilder.DropColumn(
                name: "WechatMpAppSecret",
                table: "SysSiteConfig");

            migrationBuilder.DropColumn(
                name: "WechatWebAppId",
                table: "SysSiteConfig");

            migrationBuilder.DropColumn(
                name: "WechatWebRedirectUri",
                table: "SysSiteConfig");

            migrationBuilder.DropColumn(
                name: "WechatWebSecret",
                table: "SysSiteConfig");

            migrationBuilder.AlterColumn<string>(
                name: "TenantCode",
                table: "SysSiteConfig",
                type: "nvarchar(max)",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(128)",
                oldMaxLength: 128,
                oldNullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "SmsAppId",
                table: "SysSiteConfig",
                type: "nvarchar(max)",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(128)",
                oldMaxLength: 128,
                oldNullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "Name",
                table: "SysSiteConfig",
                type: "nvarchar(max)",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(128)",
                oldMaxLength: 128,
                oldNullable: true);
        }
    }
}
